/*---------------------------------------------------
-----------------------------------------------------
Filename:	songinfo.m
Version:	1.0

Type:		maki
Date:		20. Nov. 2006 - 22:47 
Author:		Martin Poehlmann aka Deimos
E-Mail:		martin@skinconsortium.com
Internet:	www.skinconsortium.com
		www.martin.deimos.de.vu
-----------------------------------------------------
---------------------------------------------------*/

#include <lib/std.mi>
#include attribs/init_appearance.m

Global Group MenuBar;

System.onScriptLoaded()
{
	initAttribs_Appearance();
	MenuBar = getscriptgroup().findobject("player.mainmenu");

	if (menubar_main_attrib.getData() == "1")
	{
		MenuBar.show();
	}
	else
	{
		MenuBar.hide();
	}
}

menubar_main_attrib.onDataChanged() {
	if (getData() == "1")
	{
		MenuBar.cancelTarget();
		MenuBar.setTargetH(16);
		MenuBar.setTargetSpeed(0.5);
		MenuBar.gotoTarget();
	}
	else
	{
		MenuBar.cancelTarget();
		MenuBar.setTargetH(0);
		MenuBar.setTargetSpeed(0.5);
		MenuBar.gotoTarget();
	}
}

System.onKeyDown(String k) {
	if (menubar_main_attrib.getData() == "0") return;
	Layout l = getScriptGroup().getParentLayout();
	if (!l.isActive()) return;
	if (k == "alt+f")
	{
		MenuBar.findObject("File.menu").sendAction("open", "", 0, 0, 0, 0);
		complete;
	}
	if (k == "alt+p")
	{
		MenuBar.findObject("Play.menu").sendAction("open", "", 0, 0, 0, 0);
		complete;
	}
	if (k == "alt+o")
	{
		MenuBar.findObject("Options.menu").sendAction("open", "", 0, 0, 0, 0);
		complete;
	}
	if (k == "alt+i")
	{
		MenuBar.findObject("View.menu").sendAction("open", "", 0, 0, 0, 0);
		complete;
	}
	if (k == "alt+h")
	{
		MenuBar.findObject("Help.menu").sendAction("open", "", 0, 0, 0, 0);
		complete;
	}
	if (k == "alt")
	{
		MenuBar.findObject("File.menu").sendAction("preopen", "", 0, 0, 0, 0);
		complete;
	}
}
